<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta name="renderer" content="webkit|ie-comp|ie-stand">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta http-equiv="Cache-Control" content="no-siteapp" />
		<link href="__MODES__/assets/css/bootstrap.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="__CSS__/style.css" />
		<link href="__MODES__/assets/css/codemirror.css" rel="stylesheet">
		<link rel="stylesheet" href="__MODES__/assets/css/ace.min.css" />
		<link rel="stylesheet" href="__MODES__/assets/css/font-awesome.min.css" />
		<!--[if IE 7]>
	  <link rel="stylesheet" href="__MODES__/assets/css/font-awesome-ie7.min.css" />
	<![endif]-->
		<!--[if lte IE 8]>
	  <link rel="stylesheet" href="__MODES__/assets/css/ace-ie.min.css" />
	<![endif]-->
		<script src="__PLUGINS__/jquery-1.9.1.min.js"></script>
		<script src="__MODES__/assets/js/bootstrap.min.js"></script>
		<script src="__MODES__/assets/js/typeahead-bs2.min.js"></script>
		<script src="__MODES__/assets/js/jquery-ui-1.10.3.custom.min.js"></script>
		<script src="__MODES__/assets/js/jquery.ui.touch-punch.min.js"></script>
		<script src="__MODES__/assets/js/ace-elements.min.js"></script>
		<script src="__MODES__/assets/js/ace.min.js"></script>
		<title>添加文章</title>

		<script src="__PLUGINS__/layer/layer.js"></script>
		<script src="__PLUGINS__/common.js"></script>

	</head>

	<body>
		<div class="margin clearfix">
			<div class="stystems_style">
				<div class="tabbable">

					<div class="tab-content">
						<form name="bank-form" id="bank-form" action="">
						<div id="home" class="tab-pane active">
							<div class="form-group"><label class="col-sm-2 control-label no-padding-right" for="form-field-1"><i>*</i>申请通道名称：</label>
								<div class="col-sm-8"><input type="text" value="" name="apply_name" id="apply_name" class="col-xs-10 "></div>
							</div>
							<div class="form-group"><label class="col-sm-2 control-label no-padding-right" for="form-field-1"><i>*</i>渠道支付名称：</label>
								<div class="col-sm-8"><input type="text" value="" name="apply_qdname" id="apply_qdname" class="col-xs-10 "></div>
							</div>
							<div class="form-group"><label class="col-sm-2 control-label no-padding-right" for="form-field-1"><i>*</i>费率（扣款）：</label>
								<div class="col-sm-8"><input type="text" value="" name="apply_rate" id="apply_rate" class="col-xs-10 "></div>
							</div>
							<div class="form-group"><label class="col-sm-2 control-label no-padding-right" for="form-field-1"><i>*</i>申请类别： </label>
								<div class="col-sm-8">
									<select name='apply_type' id="apply_type" class="col-xs-10 " style="margin-left:10px ">
										<option value="">请选择</option>
										<option value="1">信用卡申请</option>
										<option value="2">网贷申请</option>
										<option value="3">积分兑换</option>
									</select>
								</div>
							</div>
							<div class="form-group"><label class="col-sm-2 control-label no-padding-right" for="form-field-1"><i>*</i>控制器：</label>
								<div class="col-sm-8"><input type="text" value="" name="payment_controller" id="payment_controller" class="col-xs-10 "></div>
							</div>
							<div class="form-group"><label class="col-sm-2 control-label no-padding-right" for="form-field-1"><i>*</i>配置参数： </label>
								<div class="col-sm-8">
									<textarea class="col-xs-10" name="apply_config" id="apply_config" style="height: 100px" name="body"></textarea>
								</div>
							</div>
							
							<div class="Button_operation">
								<button onclick="saveSubmit();" id="bank-btn" class="btn btn-primary radius" type="button"><i class="fa fa-save "></i>&nbsp;保存</button>
							</div>
						</div>
						</form>
					</div>
				</div>
			</div>

		</div>
		
		<script>
			function saveSubmit () {

				var name   = $('#apply_name').val();
				var qname  = $('#apply_qdname').val();
				var reta   = $('#apply_rate').val();
				var type   = $('#apply_type').val();
				var con    = $('#payment_controller').val();
				var config = $('#apply_config').val();

				if(name == ''){
					layer.msg('必填项不可为空');
					return false;
				}
				if(qname == ''){
					layer.msg('必填项不可为空');
					return false;
				}
				if(reta == ''){
					layer.msg('必填项不可为空');
					return false;
				}
				if(type == ''){
					layer.msg('必填项不可为空');
					return false;
				}
				if(con == ''){
					layer.msg('必填项不可为空');
					return false;
				}
				if(config == ''){
					layer.msg('必填项不可为空');
					return false;
				}

				var url    = $("#bank-form").attr('action');
				var data   = $("#bank-form").serialize();
				ajaxPost(url,$("#bank-btn"),data,function (r) {
		            $("#bank-btn").removeAttr('disabled');
		            //location.reload();
                    window.parent.location.reload();
		            var index = parent.layer.getFrameIndex(window.name);
					parent.layer.close(index);
		        })
			}
		</script>

	</body>

</html>